package scau.zzf.web.login;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import scau.zzf.base.common.BaseController;
import scau.zzf.base.common.Result;
import scau.zzf.base.shiro.LoginHelper;
import scau.zzf.dictionary.LoginCode;

/** 平台管理员和理发店管理员控制器
 * Created by zzf on 2017/4/30.
 */
@Api(description = "总后台--登陆",tags = "总后台--登陆")
@RestController
@RequestMapping(value = "/tan90",produces = MediaType.APPLICATION_JSON_UTF8_VALUE   )
public class PlatLoginController extends BaseController{

    /**
     * @author zzf
     */
    @ApiOperation("登陆")
    @PostMapping("/login")
    Result checkLogin(@RequestParam String username, @RequestParam String password) {
        LoginCode code = LoginHelper.login(username, password);
        //处理登陆认证之后的操作
        return Result.Build(code);
    }


}
